<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title><?php echo ($meta_title); ?>|创世管理平台</title>
    <link href="/Public/favicon.ico" type="image/x-icon" rel="shortcut icon">
    <link rel="stylesheet" type="text/css" href="/Public/Admin/css/base.css" media="all">
    <link rel="stylesheet" type="text/css" href="/Public/Admin/css/common.css" media="all">
    <link rel="stylesheet" type="text/css" href="/Public/Admin/css/module.css">
    <link rel="stylesheet" type="text/css" href="/Public/Admin/css/style.css" media="all">
	<link rel="stylesheet" type="text/css" href="/Public/Admin/css/<?php echo (C("COLOR_STYLE")); ?>.css" media="all">
	<!--<link rel="stylesheet" type="text/css" href="/Public/static/layui/layui/css/layui.css" media="all">-->
     <!--[if lt IE 9]>
    <script type="text/javascript" src="/Public/static/jquery-1.10.2.min.js"></script>
    <![endif]--><!--[if gte IE 9]><!-->
    <script type="text/javascript" src="/Public/static/jquery-2.0.3.min.js"></script>
    <!--<script type="text/javascript" src="/Public/static/layui/layui/layui.js"></script>-->
    <script type="text/javascript" src="/Public/Admin/js/jquery.mousewheel.js"></script>

    <!--<![endif]-->
    
    <style type="text/css">
        .btn {

            background: #09c;
        }

        .btn:hover {
            background: #09c;
        }

        body {
            color: #000;
            font-family: '宋体';

        }

        .code {
            width: 135px;
            height: 40px;
            border: none;
            background: #4BBD00;
            color: #fff;
        }

        .side-sub-menu > li > .item {
            color: #000;
            font-family: '宋体';
            font-size: 15px;
            padding: 0px;
            line-height: 25px;
        }

        .sidebar {
            background: #3697A0;
            position: absolute;
        }

        form .form-item {
            width: 50%;

        }

        /* 头部Logo,主导航*/
        body {
            color: #000;
            font-family: '宋体';
            font-weight: 900;
        }

        .header {
            background-color: #3697A0;
            height: 45px;
        }

        /* 主导航 */
        .main-nav a {
            height: 45px;
            color: #150303;
        }

        .main-nav a:hover {
            height: 45px;
            background-color: #70bcf3;
            color: #150303;
        }

        .main-nav .current {
            height: 45px;
            background-color: #70bcf3;
        }

        .main-nav .current a {
            height: 45px;
            background-color: #70bcf3;
            color: #150303;
        }

        .logo {
            height: 45px;
            background: #ccc;
        }

        .sidebar {
            margin-top: -5px;
            background: #3697A0;
            color: #000;
            position: fixed;
            height: 110%;
            margin-top: -40px;
        }

        .subnav h3 {
            color: #000;
        }

        .main-nav {
            /*width:100%;*/
            float: none;
            height: auto;
        }

        .mainnav {
            /*height: auto;*/
            height: 100%;
        }

        .main-nav li {
            float: none;
            width: 180px;
        }


    </style>

</head>
<body >
    <!-- 头部 -->
    <div class="header">
        <!-- Logo -->
        <!-- <span class="logo" style="/*background:url(/Public/Admin/images/bg_lf.png) no-repeat;*/"></span> -->
        <!-- /Logo -->

        <!-- 主导航 -->
        <!-- <ul class="main-nav" style="float:left">
            <?php if(is_array($__MENU__["main"])): $i = 0; $__LIST__ = $__MENU__["main"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$menu): $mod = ($i % 2 );++$i;?><li class="<?php echo ((isset($menu["class"]) && ($menu["class"] !== ""))?($menu["class"]):''); ?>" style="float:left"><a href="<?php echo (u($menu["url"])); ?>"><?php echo ($menu["title"]); ?></a></li><?php endforeach; endif; else: echo "" ;endif; ?>
        </ul> -->
        <!-- /主导航 -->

        <!-- 用户栏 -->
        <div class="user-bar">
            <a href="javascript:;" class="user-entrance"><i class="icon-user"></i></a>
            <ul class="nav-list user-menu hidden">
                <li class="manager">你好，<em title="<?php echo session('user_auth.username');?>"><?php echo session('user_auth.username');?></em></li>
                <li><a href="<?php echo U('User/updatePassword');?>">修改密码</a></li>
                <li><a href="<?php echo U('User/updateNickname');?>">修改昵称</a></li>
                <li><a href="<?php echo U('Public/logout');?>">退出</a></li>
            </ul>
        </div>
    </div>
    <!-- /头部 -->

    <!-- 边栏 -->
    <div class="sidebar" >
        <!-- 子导航 -->
        
            <ul class="main-nav" style="font-size:16px;">
                <?php if(is_array($__MENU__["main"])): $i = 0; $__LIST__ = $__MENU__["main"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$menu): $mod = ($i % 2 );++$i;?><li class="<?php echo ((isset($menu["class"]) && ($menu["class"] !== ""))?($menu["class"]):''); ?>"><a href="<?php echo (u($menu["url"])); ?>"><?php echo ($menu["title"]); ?></a></li><?php endforeach; endif; else: echo "" ;endif; ?>
            </ul>

            <div id="subnav" class="subnav" >
                <?php if(!empty($_extra_menu)): ?>
                    <?php echo extra_menu($_extra_menu,$__MENU__); endif; ?>
                <?php if(is_array($__MENU__["child"])): $i = 0; $__LIST__ = $__MENU__["child"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$sub_menu): $mod = ($i % 2 );++$i;?><!-- 子导航 -->
                    <?php if(!empty($sub_menu)): if(!empty($key)): ?><h3><i class="icon"></i><?php echo ($key); ?></h3><?php endif; ?>
                        <ul class="side-sub-menu">
                            <?php if(is_array($sub_menu)): $i = 0; $__LIST__ = $sub_menu;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$menu): $mod = ($i % 2 );++$i;?><li>
                                    <a class="item" href="<?php echo (u($menu["url"])); ?>"><?php echo ($menu["title"]); ?></a>
                                </li><?php endforeach; endif; else: echo "" ;endif; ?>
                        </ul><?php endif; ?>
                    <!-- /子导航 --><?php endforeach; endif; else: echo "" ;endif; ?>
            </div>
        
        <!-- /子导航 -->
    </div>
    <!-- /边栏 -->

    <!-- 内容区 -->
    <div id="main-content">
        <div id="top-alert" class="fixed alert alert-error" style="display: none;">
            <button class="close fixed" style="margin-top: 4px;">&times;</button>
            <div class="alert-content">这是内容</div>
        </div>
        <div id="main" class="main" style="padding:20px;margin-top:-5px;margin-left: -20px;">
            
            <!-- nav -->
            <?php if(!empty($_show_nav)): ?><div class="breadcrumb">
                <span>您的位置:</span>
                <?php $i = '1'; ?>
                <?php if(is_array($_nav)): foreach($_nav as $k=>$v): if($i == count($_nav)): ?><span><?php echo ($v); ?></span>
                    <?php else: ?>
                    <span><a href="<?php echo ($k); ?>"><?php echo ($v); ?></a>&gt;</span><?php endif; ?>
                    <?php $i = $i+1; endforeach; endif; ?>
            </div><?php endif; ?>
            <!-- nav -->
            

            
    <div class="main-title">
        <h2>支付宝配置</h2>
    </div>


    <!-- 标签页导航 -->
    <div class="tab-wrap" style="position:relative">
        <div class="tab-content">
            <ul class="tab-nav nav">
                <li data-tab="tab1" class="current"><a href="javascript:void(0);">手机网站支付配置</a></li>
                <li data-tab="tab2" class=""><a href="javascript:void(0);">商户提现配置 </a></li>
                <li data-tab="tab3" class=""><a href="javascript:void(0);">当面付分账提现配置</a></li>
                <li data-tab="tab4" class=""><a href="javascript:void(0);">当面付授权配置</a></li>
            </ul>


            <!-- 学籍信息  -->
            <div id="tab1" class="tab-pane in tab1">

                <div class="cf">
                    <div class="fl">
                        <button class="btn add_alipay">新增</button>

                    </div>


                </div>
                <div class="data-table table-striped">
                    <?php $map=array('type'=>1); $_list=D('Alipays')->where(['type'=>1])->select(); ?>

                    <table style="font-size:14px;">
                        <thead>
                        <tr>
                            <th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>

                            <th>ID</th>
                            <th>账号</th>
                            <th>名称</th>
                            <th>APPID</th>
                            <th>支付宝公钥</th>
                            <th>支付宝密钥</th>
                            <th>转出费率</th>
                            <th>到账支付宝账号</th>
                            <th>总收款</th>
                            <th>今日收款</th>
                            <th>使用状态</th>
                            <th>下架原因</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php if(!empty($_list)): if(is_array($_list)): $i = 0; $__LIST__ = $_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$rows): $mod = ($i % 2 );++$i;?><tr>
                                    <td><input class="ids" type="checkbox" name="id[]" value="<?php echo ($rows['id']); ?>"/></td>

                                    <td><?php echo ($rows['id']); ?></td>
                                    <td><?php echo ($rows['account']); ?></td>
                                    <td><?php echo ($rows['name']); ?></td>

                                    <td><?php echo ($rows["appid"]); ?></td>
                                    <td>

                                        <?php echo substr($rows['secret'], 0,15).'...'; ?>
                                    </td>
                                    <td>
                                        <?php echo substr($rows['public'], 0,15).'...'; ?>
                                    </td>
                                    <td><?php echo ($rows["rate_out"]); ?></td>
                                    <td><?php echo ($rows["to_alipay"]); ?></td>

                                    <td>
                                        <?php $time1=strtotime(date("Ymd",strtotime("+1 day"))); $time2=strtotime(date("Ymd")); $seller=$rows['account']; $td_sum=D('Xyk')->where(" status=1 and seller='$seller'")->sum('pay_money'); echo "<font style='color:red'>$td_sum</font>"; ?>
                                    </td>

                                    <td>
                                        <?php $time1=strtotime(date("Ymd",strtotime("+1 day"))); $time2=strtotime(date("Ymd")); $seller=$rows['account']; $sum=D('Xyk')->where(" status=1 and seller='$seller' and pay_time between
                                            $time2 and $time1")->sum('pay_money'); echo "<font style='color:red'>$sum</font>"; ?>

                                    </td>


                                    <td>
                                        <?php if($rows['status']==0){ echo '<font style="color:red">已下架</font>'; }else{ echo '上架中'; } ?>
                                    </td>

                                    <td><?php echo ($rows["cause"]); ?></td>


                                    <td>

                                        <button class="btn edit_alipay">修改</button>
                                        <button class="btn delete_alipay">删除</button>
                                        <input type="hidden" name="status" class="status" value="<?php echo ($rows["status"]); ?>">
                                        <?php if($rows['status']==0){ echo '
                                            <button class="btn  to_change_alipay">上架</button>
                                            '; }else{ echo '
                                            <button class="btn  to_change_alipay">下架</button>
                                            '; } ?>

                                    </td>
                                </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                            <?php else: ?>
                            <td colspan="14" class="text-center"> aOh! 暂时还没有内容!</td><?php endif; ?>
                        </tbody>
                    </table>


                </div>
                <div class="page" style="float:left;margin-right:300px;"><?php echo ($_page); ?></div>


                <style type="text/css">

                    #tab1 ._block {
                        width: 100%;
                        height: 100%;
                        background: rgba(0, 0, 0, 0.4);
                        position: fixed;
                        top: 0;
                        left: 0;
                    }

                    #tab1 ._block .center {
                        width: 35%;
                        height: 87%;
                        margin: auto;
                        margin-top: 4%;
                        border-radius: 10px 10px;
                        background: #fff;
                        background: rgba(112, 188, 243, 0.95);
                        border: #70bcf3;
                        padding: 1% 1%;
                    }

                    #tab1 ._block form {

                    }

                    #tab1 ._block label {
                        display: block;
                        margin-bottom: 2%;
                    }

                    #tab1 ._block .font {
                        float: left;
                        width: 27%;
                        text-align: right;
                        /*background: #fde;*/
                        margin-right: 3%;
                        font-size: 14px;

                    }

                    #tab1 .add_block {
                        display: none;
                    }
                </style>

                <div class="_block add_block">
                    <div class="center">
                        <form action="" method="post">
                            <label>
                                <font class="font">账号：</font><input type="text" name="account" style="">
                            </label>

                            <label>
                                <font class="font">名称：</font><input type="text" name="name" style="">
                            </label>


                            <label>
                                <font class="font">APPID：</font><input type="text" name="appid" style="">
                            </label>

                            <label>
                                <font class="font">秘钥：</font><textarea name="secret"
                                                                       style="width:70%;height:51%"></textarea>
                            </label>
                            <label>
                                <font class="font">公钥：</font><textarea name="public"
                                                                       style="width:70%;height:20%"></textarea>
                            </label>

                            <label>
                                <font class="font">转出费率：</font><input type="text" name="rate_out" style="">
                            </label>

                            <label>
                                <font class="font">到账支付宝账号：</font><input type="text" name="to_alipay" style="">
                            </label>

                            <label>
                                <button type="button" class="btn add_sure" style="width:27%;float:right">确 定</button>
                            </label>


                        </form>

                    </div>
                </div>


                <div class="inner_block">

                </div>


            </div>


            <!--认证资料-->
            <div id="tab2" class="tab-pane tab2">

                <div class="cf">
                    <div class="fl">
                        <button class="btn add_alipay">新增</button>

                    </div>

                </div>

                <div class="data-table table-striped">

                    <table style="font-size:14px;">
                        <?php $map=array('type'=>1); $_list2=D('Alipays')->where(['type'=>2])->select(); ?>
                        <thead>
                        <tr>
                            <th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>

                            <th>ID</th>
                            <th>账号</th>
                            <th>名称</th>
                            <th>APPID</th>
                            <th>支付宝公钥</th>
                            <th>支付宝密钥</th>
                            <th>今日可用余额</th>
                            <th>使用状态</th>
                            <th>下架原因</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php if(!empty($_list2)): if(is_array($_list2)): $i = 0; $__LIST__ = $_list2;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$rows): $mod = ($i % 2 );++$i;?><tr>
                                    <td><input class="ids" type="checkbox" name="id[]" value="<?php echo ($rows['id']); ?>"/></td>

                                    <td><?php echo ($rows['id']); ?></td>
                                    <td><?php echo ($rows['account']); ?></td>
                                    <td><?php echo ($rows['name']); ?></td>

                                    <td><?php echo ($rows["appid"]); ?></td>
                                    <td>

                                        <?php echo substr($rows['secret'], 0,15).'...'; ?>
                                    </td>
                                    <td>
                                        <?php echo substr($rows['public'], 0,15).'...'; ?>
                                    </td>
                                    <td>

                                        <?php $time1=strtotime(date("Ymd",strtotime("+1 day"))); $time2=strtotime(date("Ymd")); $appid=$rows['appid']; $sum=D('Ykextract')->where("appid='$appid' and `danhao` LIKE 'al%' and
                                            e_time between $time2 and $time1")->sum('money'); $sum=1000000-$sum; echo "<font style='color:red'>$sum</font>"; ?>


                                    </td>
                                    <td>
                                        <?php if($rows['status']==0){ echo '<font style="color:red">已下架</font>'; }else{ echo '上架中'; } ?>
                                    </td>

                                    <td><?php echo ($rows["cause"]); ?></td>


                                    <td>

                                        <button class="btn edit_alipay">修改</button>
                                        <button class="btn delete_alipay">删除</button>
                                        <input type="hidden" name="status" class="status" value="<?php echo ($rows["status"]); ?>">
                                        <?php if($rows['status']==0){ echo '
                                            <button class="btn  to_change_alipay">上架</button>
                                            '; }else{ echo '
                                            <button class="btn  to_change_alipay">下架</button>
                                            '; } ?>

                                    </td>
                                </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                            <?php else: ?>
                            <td colspan="14" class="text-center"> aOh! 暂时还没有内容!</td><?php endif; ?>
                        </tbody>
                    </table>


                </div>
                <style type="text/css">

                    #tab2 ._block2 {
                        width: 100%;
                        height: 100%;
                        background: rgba(0, 0, 0, 0.4);
                        position: fixed;
                        top: 0;
                        left: 0;
                    }

                    #tab2 ._block2 .center2 {
                        width: 35%;
                        height: 87%;
                        margin: auto;
                        margin-top: 4%;
                        border-radius: 10px 10px;
                        background: #fff;
                        background: rgba(112, 188, 243, 0.95);
                        border: #70bcf3;
                        padding: 1% 1%;
                    }

                    #tab2 ._block2 form {

                    }

                    #tab2 ._block2 label {
                        display: block;
                        margin-bottom: 2%;
                    }

                    #tab2 ._block2 .font {
                        float: left;
                        width: 27%;
                        text-align: right;
                        /*background: #fde;*/
                        margin-right: 3%;
                        font-size: 14px;

                    }

                    #tab2 .add_block2 {
                        display: none;
                    }
                </style>

                <div class="_block2 add_block2">
                    <div class="center2">
                        <form action="" method="post">
                            <label>
                                <font class="font">账号：</font><input type="text" name="account" style="">
                            </label>

                            <label>
                                <font class="font">名称：</font><input type="text" name="name" style="">
                            </label>


                            <label>
                                <font class="font">APPID：</font><input type="text" name="appid" style="">
                            </label>

                            <label>
                                <font class="font">秘钥：</font><textarea name="secret"
                                                                       style="width:70%;height:55%"></textarea>
                            </label>
                            <label>
                                <font class="font">公钥：</font><textarea name="public"
                                                                       style="width:70%;height:20%"></textarea>
                            </label>

                            <label>
                                <button type="button" class="btn add_sure2" style="width:27%;float:right">确 定</button>
                            </label>


                        </form>

                    </div>
                </div>


                <div class="inner_block2">

                </div>


            </div>

            <div id="tab3" class="tab-pane tab3">
                <?php $info=D('Adata')->find(); ?>
                <form action="<?php echo U();?>" method="post" class="form-horizontal">


                    <!--<div class="form-item">-->
                        <!--<label class="item-label">收款支付宝appid</label>-->
                        <!--<div class="controls">-->
                            <!--<input type="text" style="height:30px;" class="text input-large" name="appid"-->
                                   <!--value="<?php echo ($info["appid"]); ?>">-->
                        <!--</div>-->
                    <!--</div>-->
                    <!--<div class="form-item">-->
                        <!--<label class="item-label">收款支付宝secret</label>-->
                        <!--<div class="controls">-->
                            <!--<textarea name="secret" style="width:900px;height:300px;border:1px solid #ccc"-->
                                      <!--value="<?php echo ($info["secret"]); ?>"><?php echo ($info["secret"]); ?></textarea>-->
                            <!--&lt;!&ndash; <input type="text" style="height:30px;" class="text input-large" name="secret"  value="<?php echo ($info["secret"]); ?>"> &ndash;&gt;-->
                        <!--</div>-->
                    <!--</div>-->
                    <!--<div class="form-item">-->
                        <!--<label class="item-label">收款支付宝public</label>-->
                        <!--<div class="controls">-->
                            <!--<textarea name="public" style="width:900px;height:100px;" value="<?php echo ($info["public"]); ?>"><?php echo ($info["public"]); ?></textarea>-->
                            <!--&lt;!&ndash; <input type="text" style="height:30px;" class="text input-large" name="public" value="<?php echo ($info["public"]); ?>"> &ndash;&gt;-->
                        <!--</div>-->
                    <!--</div>-->
                    <div class="form-item">
                        <label class="item-label">分账支付宝partnerid</label>
                        <div class="controls">
                            <input type="text" style="height:30px;" class="text input-large" name="t_account"
                                   value="<?php echo ($info["t_account"]); ?>">
                        </div>
                    </div>

                    <div class="form-item">
                        <label class="item-label">提现支付宝appid</label>
                        <div class="controls">
                            <input type="text" style="height:30px;" class="text input-large" name="tx_appid"
                                   value="<?php echo ($info["tx_appid"]); ?>">
                        </div>
                    </div>
                    <div class="form-item">
                        <label class="item-label">提现支付宝secret</label>
                        <div class="controls">
                            <textarea name="tx_secret" style="width:900px;height:300px;" value="<?php echo ($info["tx_secret"]); ?>"><?php echo ($info["tx_secret"]); ?></textarea>
                            <!-- <input type="text" style="height:30px;" class="text input-large" name="tx_secret" value="<?php echo ($info["tx_secret"]); ?>"> -->
                        </div>
                    </div>
                    <div class="form-item">
                        <label class="item-label">提现支付宝public</label>
                        <div class="controls">
                            <textarea name="tx_public" style="width:900px;height:100px;" value="<?php echo ($info["tx_public"]); ?>"><?php echo ($info["tx_public"]); ?></textarea>
                            <!-- <input type="text" style="height:30px;" class="text input-large" name="tx_public" value="<?php echo ($info["tx_public"]); ?>"> -->
                        </div>
                    </div>


                    <div class="form-item" style="color:red">
                        更换时，appid、secret、public缺一不可，secret、public必须使用RSA2且必须对应，不可带空格或者换行，千万不要改成空的进行保存！
                    </div>


                    <div class="form-item">
                        <button class="btn submit-btn" id="submit" type="button" target-form="form-horizontal">确 定
                        </button>
                        <button class="btn btn-return" onclick="javascript:history.back(-1);return false;">返 回</button>

                    </div>


                </form>

            </div>

            <!-- 当面付授权配置 -->
            <div id="tab4" class="tab-pane tab4">

                <div class="cf">
                    <div class="fl">
                        <button class="btn add_alipay">新增</button>

                    </div>


                </div>
                <div class="data-table table-striped">
                    <?php $map=array('type'=>1); $_list=D('Alipays')->where(['type'=>1])->select(); ?>

                    <table style="font-size:14px;">
                        <thead>
                        <tr>
                            <th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>

                            <th>ID</th>
                            <th>账号</th>
                            <th>名称</th>
                            <th>APPID</th>
                            <th>支付宝公钥</th>
                            <th>支付宝密钥</th>

                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <?php if(!empty($huabeilist)): if(is_array($huabeilist)): $i = 0; $__LIST__ = $huabeilist;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$rows): $mod = ($i % 2 );++$i;?><tr>
                                    <td><input class="ids" type="checkbox" name="id[]" value="<?php echo ($rows['id']); ?>"/></td>
                                    <td><?php echo ($rows['id']); ?></td>
                                    <td><?php echo ($rows['account']); ?></td>
                                    <td><?php echo ($rows['name']); ?></td>
                                    <td><?php echo ($rows["appid"]); ?></td>
                                    <td>

                                        <?php echo substr($rows['secret'], 0,15).'...'; ?>
                                    </td>
                                    <td>
                                        <?php echo substr($rows['public'], 0,15).'...'; ?>
                                    </td>


                                    <td><?php echo ($rows["cause"]); ?></td>


                                    <td>


                                        <button class="btn delete_alipay">删除</button>


                                    </td>
                                </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                            <?php else: ?>
                            <td colspan="14" class="text-center"> aOh! 暂时还没有内容!</td><?php endif; ?>
                        </tbody>
                    </table>


                </div>
                <div class="page" style="float:left;margin-right:300px;"><?php echo ($_page); ?></div>


                <style type="text/css">

                    #tab4 ._block {
                        width: 100%;
                        height: 100%;
                        background: rgba(0, 0, 0, 0.4);
                        position: fixed;
                        top: 0;
                        left: 0;
                    }

                    #tab4 ._block .center {
                        width: 35%;
                        height: 87%;
                        margin: auto;
                        margin-top: 4%;
                        border-radius: 10px 10px;
                        background: #fff;
                        background: rgba(112, 188, 243, 0.95);
                        border: #70bcf3;
                        padding: 1% 1%;
                    }

                    #tab4 ._block form {

                    }

                    #tab4 ._block label {
                        display: block;
                        margin-bottom: 2%;
                    }

                    #tab4 ._block .font {
                        float: left;
                        width: 27%;
                        text-align: right;
                        /*background: #fde;*/
                        margin-right: 3%;
                        font-size: 14px;

                    }

                    #tab4 .add_block {
                        display: none;
                    }
                </style>

                <div class="_block add_block">
                    <div class="center">
                        <form action="" method="post">
                            <label>
                                <font class="font">账号：</font><input type="text" name="account" style="">
                            </label>

                            <label>
                                <font class="font">名称：</font><input type="text" name="name" style="">
                            </label>


                            <label>
                                <font class="font">APPID：</font><input type="text" name="appid" style="">
                            </label>

                            <label>
                                <font class="font">秘钥：</font><textarea name="secret"
                                                                       style="width:70%;height:51%"></textarea>
                            </label>
                            <label>
                                <font class="font">公钥：</font><textarea name="public"
                                                                       style="width:70%;height:20%"></textarea>
                            </label>


                            <label>
                                <button type="button" class="btn add_sure" style="width:27%;float:right">确 定</button>
                            </label>


                        </form>

                    </div>
                </div>


                <div class="inner_block">

                </div>


            </div>


        </div>


    </div>

    <!-- <button type="button" id='kkcs'>短信测试</button> -->

        </div>
        <div class="cont-ft" style="margin-left: -20px;">
            <div class="copyright">
                <div class="fl">感谢使用<a href="#" >创世</a>管理平台</div>
                <div class="fr">V<?php echo (ONETHINK_VERSION); ?></div>
            </div>
        </div>
    </div>
    <!-- /内容区 -->
    <script type="text/javascript">
    (function(){
        var ThinkPHP = window.Think = {
            "ROOT"   : "", //当前网站地址
            "APP"    : "/index.php", //当前项目地址
            "PUBLIC" : "/Public", //项目公共目录地址
            "DEEP"   : "<?php echo C('URL_PATHINFO_DEPR');?>", //PATHINFO分割符
            "MODEL"  : ["<?php echo C('URL_MODEL');?>", "<?php echo C('URL_CASE_INSENSITIVE');?>", "<?php echo C('URL_HTML_SUFFIX');?>"],
            "VAR"    : ["<?php echo C('VAR_MODULE');?>", "<?php echo C('VAR_CONTROLLER');?>", "<?php echo C('VAR_ACTION');?>"]
        }
    })();
    </script>
    <script type="text/javascript" src="/Public/static/think.js"></script>
    <script type="text/javascript" src="/Public/Admin/js/common.js"></script>
    <script type="text/javascript">
        +function(){
            var $window = $(window), $subnav = $("#subnav"), url;
            $window.resize(function(){
                $("#main").css("min-height", $window.height() - 130);
            }).resize();

            /* 左边菜单高亮 */
            url = window.location.pathname + window.location.search;
            url = url.replace(/(\/(p)\/\d+)|(&p=\d+)|(\/(id)\/\d+)|(&id=\d+)|(\/(group)\/\d+)|(&group=\d+)/, "");
            $subnav.find("a[href='" + url + "']").parent().addClass("current");

            /* 左边菜单显示收起 */
            $("#subnav").on("click", "h3", function(){
                var $this = $(this);
                $this.find(".icon").toggleClass("icon-fold");
                $this.next().slideToggle("fast").siblings(".side-sub-menu:visible").
                      prev("h3").find("i").addClass("icon-fold").end().end().hide();
            });

            $("#subnav h3 a").click(function(e){e.stopPropagation()});

            /* 头部管理员菜单 */
            $(".user-bar").mouseenter(function(){
                var userMenu = $(this).children(".user-menu ");
                userMenu.removeClass("hidden");
                clearTimeout(userMenu.data("timeout"));
            }).mouseleave(function(){
                var userMenu = $(this).children(".user-menu");
                userMenu.data("timeout") && clearTimeout(userMenu.data("timeout"));
                userMenu.data("timeout", setTimeout(function(){userMenu.addClass("hidden")}, 100));
            });

	        /* 表单获取焦点变色 */
	        $("form").on("focus", "input", function(){
		        $(this).addClass('focus');
	        }).on("blur","input",function(){
				        $(this).removeClass('focus');
			        });
		    $("form").on("focus", "textarea", function(){
			    $(this).closest('label').addClass('focus');
		    }).on("blur","textarea",function(){
			    $(this).closest('label').removeClass('focus');
		    });

            // 导航栏超出窗口高度后的模拟滚动条
            var sHeight = $(".sidebar").height();
            var subHeight  = $(".subnav").height();
            var diff = subHeight - sHeight; //250
            var sub = $(".subnav");
            if(diff > 0){
                $(window).mousewheel(function(event, delta){
                    if(delta>0){
                        if(parseInt(sub.css('marginTop'))>-10){
                            sub.css('marginTop','0px');
                        }else{
                            sub.css('marginTop','+='+10);
                        }
                    }else{
                        if(parseInt(sub.css('marginTop'))<'-'+(diff-10)){
                            sub.css('marginTop','-'+(diff-10));
                        }else{
                            sub.css('marginTop','-='+10);
                        }
                    }
                });
            }
        }();
    </script>

    
    <script type="text/javascript" src="/Public/static/jquery.dragsort-0.5.1.min.js"></script>


    <script type="text/javascript">
        Think.setValue("extend", <?php echo ((isset($info["extend "]) && ($info["extend "] !== ""))?($info["extend "]): 0); ?>)
        ;
        //导航高亮
        highlight_subnav('<?php echo U('
        set_alipay
        ');?>'
        )
        ;


        $(function () {
            showTab();
        })


    </script>


    <script type="text/javascript">
        //点击隐藏
        $("#tab1 .add_block .center").click(function (e) {
            $('#tab1 .add_block ').show();
            e.stopPropagation();//阻止冒泡
        });
        $(' #tab1 .add_block').click(function () {
            $("#tab1 .add_block").hide();

        })


        $('#tab1 .add_alipay').click(function () {
            $('#tab1 .add_block').show()
        })

        $('#tab1 .add_block .add_sure').click(function () {
            var data = $(' #tab1 .add_block form').serializeArray();
            var url = "<?php echo U('Alipay/alipay_list');?>"
            $.ajax({
                type: 'post',
                url: url,
                data: {'data': data, 'type': '1'},
                success: function (m) {
                    if (m > 0) {
                        location.reload()
                    } else {
                        alert('添加失败')
                    }

                }
            })


        })


        $('#tab1 .edit_alipay').click(function () {
            var id = $(this).parent().parent().find('.ids').val()
            // alert(id)
            var url = "<?php echo U('Alipay/alipay_list');?>"
            $.ajax({
                type: 'post',
                url: url,
                data: {'id': id, 'type': '2'},
                dataType: 'json',
                success: function (m) {
                    // console.log(m)
                    // if(m.info!=''&&m.info==0){
                    //     alert('查找失败，请刷新重试')
                    // }else{


                    var str = ''
                    str += '<div class="_block edit_block">'
                    // alert(str)
                    str += '<div class="center">'
                    str += '<form action="" method="post">'
                    str += '<input name="id" class="id" type="hidden" value="' + m.id + '">'
                    str += '<label><font class="font">账号：</font><input type="text" name="account" value="' + m.account + '"></label>'

                    str += '<label><font class="font">名称：</font><input type="text" name="name" value="' + m.name + '"></label>'


                    str += '<label><font class="font">APPID：</font><input type="text" name="appid" value="' + m.appid + '"></label>'

                    str += '<label><font class="font">秘钥：</font><textarea name="secret" style="width:70%;height:51%">' + m.secret + '</textarea></label>'
                    str += '<label><font class="font">公钥：</font><textarea name="public" style="width:70%;height:20%">' + m.public + '</textarea></label>'

                    str += '<label><font class="font">转出费率：</font><input type="text" name="rate_out" value="' + m.rate_out + '"></label>'

                    str += '<label><font class="font">到账支付宝账号：</font><input type="text" name="to_alipay" value="' + m.to_alipay + '"></label>'

                    str += '<label><button type="button" class="btn edit_sure" style="width:27%;float:right">确 定</button></label>'


                    str += '</form></div></div>'


                    $('.inner_block').html(str)

                    str = ''

                    // }
                }
            })


        })

        $(".inner_block").on('click', '.edit_block .center', function () {
            e.stopPropagation();//阻止冒泡
        })

        $('.inner_block ').click(function () {
            $('.inner_block').html('')

        })


        $(".inner_block").on('click', '.edit_block .edit_sure', function () {
            var data = $('.edit_block form').serializeArray();
            var url = "<?php echo U('Alipay/alipay_list');?>"
            var id = $('.inner_block .id').val()
            $.ajax({
                type: 'post',
                url: url,
                data: {'data': data, 'type': '3', 'id': id},
                success: function (m) {
                    if (m > 0) {
                        location.reload()
                    } else {
                        alert('修改失败')
                    }

                }
            })
        })


        $('#tab1  .delete_alipay').click(function () {

            var id = $(this).parent().parent().find('.ids').val()
            var url = "<?php echo U('Alipay/alipay_list');?>"
            $.ajax({
                type: 'post',
                url: url,
                data: {'id': id, 'type': '4'},
                success: function (m) {
                    if (m > 0) {
                        location.reload()
                    } else {
                        alert('删除失败')
                    }

                }
            })

        })


        $('#tab1  .to_change_alipay').click(function () {

            var id = $(this).parent().parent().find('.ids').val()
            var status = $(this).parent().find('.status').val()

            // alert(status)
            var url = "<?php echo U('Alipay/alipay_list');?>"
            $.ajax({
                type: 'post',
                url: url,
                data: {'id': id, 'type': '5', 'status': status},
                success: function (m) {
                    if (m > 0) {
                        location.reload()
                    } else {
                        alert('操作失败')
                    }

                }
            })

        })


    </script>


    <script type="text/javascript">
        //点击隐藏
        $(".add_block2 .center2").click(function (e) {
            $('.add_block2 ').show();
            e.stopPropagation();//阻止冒泡
        });
        $(' .add_block2').click(function () {
            $(".add_block2").hide();

        })


        $('#tab2 .add_alipay').click(function () {
            $('.add_block2').show()
        })

        $('.add_block2 .add_sure2').click(function () {
            var data = $(' .add_block2 form').serializeArray();
            var url = "<?php echo U('Alipay/tx_alipay_list');?>"
            $.ajax({
                type: 'post',
                url: url,
                data: {'data': data, 'type': '1'},
                success: function (m) {
                    if (m > 0) {
                        location.reload()
                    } else {
                        alert('添加失败')
                    }

                }
            })


        })


        $('#tab2 .edit_alipay').click(function () {
            var id = $(this).parent().parent().find('.ids').val()
            var url = "<?php echo U('Alipay/tx_alipay_list');?>"
            $.ajax({
                type: 'post',
                url: url,
                data: {'id': id, 'type': '2'},
                dataType: 'json',
                success: function (m) {
                    // console.log(m)
                    // if(m.info!=''&&m.info==0){
                    //     alert('查找失败，请刷新重试')
                    // }else{


                    var str = ''
                    str += '<div class="_block2 edit_block2">'
                    // alert(str)
                    str += '<div class="center2">'
                    str += '<form action="" method="post">'
                    str += '<input name="id" class="id" type="hidden" value="' + m.id + '">'
                    str += '<label><font class="font">账号：</font><input type="text" name="account" value="' + m.account + '"></label>'

                    str += '<label><font class="font">名称：</font><input type="text" name="name" value="' + m.name + '"></label>'

                    str += '<label><font class="font">APPID：</font><input type="text" name="appid" value="' + m.appid + '"></label>'

                    str += '<label><font class="font">秘钥：</font><textarea name="secret" style="width:70%;height:55%">' + m.secret + '</textarea></label>'
                    str += '<label><font class="font">公钥：</font><textarea name="public" style="width:70%;height:20%">' + m.public + '</textarea></label>'

                    str += '<label><button type="button" class="btn edit_sure2" style="width:27%;float:right">确 定</button></label>'


                    str += '</form></div></div>'


                    $('.inner_block2').html(str)

                    str = ''

                    // }
                }
            })


        })

        $(".inner_block2").on('click', '.edit_block2 .center2', function () {
            e.stopPropagation();//阻止冒泡
        })

        $('.inner_block2 ').click(function () {
            $('.inner_block2').html('')

        })


        $(".inner_block2").on('click', '.edit_block2 .edit_sure2', function () {
            var data = $(' .edit_block2 form').serializeArray();
            var url = "<?php echo U('Alipay/tx_alipay_list');?>"
            var id = $('.inner_block2 .id').val()
            $.ajax({
                type: 'post',
                url: url,
                data: {'data': data, 'type': '3', 'id': id},
                success: function (m) {
                    if (m > 0) {
                        location.reload()
                    } else {
                        alert('修改失败')
                    }

                }
            })
        })


        $('#tab2 .delete_alipay').click(function () {

            var id = $(this).parent().parent().find('.ids').val()
            var url = "<?php echo U('Alipay/tx_alipay_list');?>"
            $.ajax({
                type: 'post',
                url: url,
                data: {'id': id, 'type': '4'},
                success: function (m) {
                    if (m > 0) {
                        location.reload()
                    } else {
                        alert('删除失败')
                    }

                }
            })

        })


        $('#tab2 .to_change_alipay').click(function () {

            var id = $(this).parent().parent().find('.ids').val()
            var status = $(this).parent().find('.status').val()

            // alert(status)
            var url = "<?php echo U('Alipay/tx_alipay_list');?>"
            $.ajax({
                type: 'post',
                url: url,
                data: {'id': id, 'type': '5', 'status': status},
                success: function (m) {
                    if (m > 0) {
                        location.reload()
                    } else {
                        alert('操作失败')
                    }

                }
            })

        })


        $('#submit').click(function () {
            var data = $('form').serializeArray();
            $.ajax({
                type: 'post',
                url: "<?php echo U('change_al');?>",
                data: data,
                success: function (m) {
                    if (m >= 1) {
                        alert('修改成功！');
                        location.reload();
                    } else if (m == 0) {
                        alert('修改失败！');
                    } else {
                        alert(m)
                    }
                }

            })
        })


    </script>
    <!-- 当面付授权配置 -->
    <script type="text/javascript">
        //点击隐藏
        $("#tab4 .add_block .center").click(function (e) {
            $('#tab4 .add_block ').show();
            e.stopPropagation();//阻止冒泡
        });
        $(' #tab4 .add_block').click(function () {
            $("#tab4 .add_block").hide();

        })


        $('#tab4 .add_alipay').click(function () {
            $('#tab4 .add_block').show()
        })

        $('#tab4 .add_block .add_sure').click(function () {
//            var data=$(' #tab4 .add_block form').serializeArray();

            var account = $(' #tab4 .add_block form input[name="account"]').val();
            var name = $(' #tab4 .add_block form input[name="name"]').val();
            var appid = $(' #tab4 .add_block form input[name="appid"]').val();
            var secret = $(' #tab4 .add_block form textarea[name="secret"]').val();
            var public = $(' #tab4 .add_block form textarea[name="public"]').val();

            var url = "<?php echo U('Alipay/addDangmianfuShouquan');?>"
            $.ajax({
                type: 'post',
                url: url,
                data: {'account': account, name: name, appid: appid, secret: secret, public: public},
                success: function (m) {
                    console.log(m);
                    if (m > 0) {
                        location.reload()
                    } else {
                        alert('添加失败')
                    }

                }
            })


        })


        $('#tab4 .edit_alipay').click(function () {
            var id = $(this).parent().parent().find('.ids').val()
            // alert(id)
            var url = "<?php echo U('Alipay/alipay_list');?>"
            $.ajax({
                type: 'post',
                url: url,
                data: {'id': id, 'type': '2'},
                dataType: 'json',
                success: function (m) {
                    // console.log(m)
                    // if(m.info!=''&&m.info==0){
                    //     alert('查找失败，请刷新重试')
                    // }else{


                    var str = ''
                    str += '<div class="_block edit_block">'
                    // alert(str)
                    str += '<div class="center">'
                    str += '<form action="" method="post">'
                    str += '<input name="id" class="id" type="hidden" value="' + m.id + '">'
                    str += '<label><font class="font">账号：</font><input type="text" name="account" value="' + m.account + '"></label>'

                    str += '<label><font class="font">名称：</font><input type="text" name="name" value="' + m.name + '"></label>'


                    str += '<label><font class="font">APPID：</font><input type="text" name="appid" value="' + m.appid + '"></label>'

                    str += '<label><font class="font">秘钥：</font><textarea name="secret" style="width:70%;height:51%">' + m.secret + '</textarea></label>'
                    str += '<label><font class="font">公钥：</font><textarea name="public" style="width:70%;height:20%">' + m.public + '</textarea></label>'

                    str += '<label><font class="font">转出费率：</font><input type="text" name="rate_out" value="' + m.rate_out + '"></label>'

                    str += '<label><font class="font">到账支付宝账号：</font><input type="text" name="to_alipay" value="' + m.to_alipay + '"></label>'

                    str += '<label><button type="button" class="btn edit_sure" style="width:27%;float:right">确 定</button></label>'


                    str += '</form></div></div>'


                    $('.inner_block').html(str)

                    str = ''

                    // }
                }
            })


        })

        $(".inner_block").on('click', '.edit_block .center', function () {
            e.stopPropagation();//阻止冒泡
        })

        $('.inner_block ').click(function () {
            $('.inner_block').html('')

        })


        $(".inner_block").on('click', '.edit_block .edit_sure', function () {
            var data = $('.edit_block form').serializeArray();
            var url = "<?php echo U('Alipay/alipay_list');?>"
            var id = $('.inner_block .id').val()
            $.ajax({
                type: 'post',
                url: url,
                data: {'data': data, 'type': '3', 'id': id},
                success: function (m) {
                    if (m > 0) {
                        location.reload()
                    } else {
                        alert('修改失败')
                    }

                }
            })
        })


        $('#tab4  .delete_alipay').click(function () {

            var id = $(this).parent().parent().find('.ids').val()
            var url = "<?php echo U('Alipay/deleteDangmianfuShouquan');?>"
            $.ajax({
                type: 'get',
                url: url,
                data: {'id': id},
                success: function (m) {
                    if (m > 0) {
                        location.reload()
                    } else {
                        alert('删除失败')
                    }

                }
            })

        })


        $('#tab4  .to_change_alipay').click(function () {

            var id = $(this).parent().parent().find('.ids').val()
            var status = $(this).parent().find('.status').val()

            // alert(status)
            var url = "<?php echo U('Alipay/alipay_list');?>"
            $.ajax({
                type: 'post',
                url: url,
                data: {'id': id, 'type': '5', 'status': status},
                success: function (m) {
                    if (m > 0) {
                        location.reload()
                    } else {
                        alert('操作失败')
                    }

                }
            })

        })


    </script>



</body>
</html>